home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb-4.5 / sun4.md / config.sub < prev    next >
Encoding:
Text File  |  1992-06-09  |  10.6 KB  |  569 lines

  1. #!/bin/sh
  2. # Configuration validation subroutine script, version 1.0.
  3. #   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  4.  
  5. #This file is free software; you can redistribute it and/or modify
  6. #it under the terms of the GNU General Public License as published by
  7. #the Free Software Foundation; either version 2 of the License, or
  8. #(at your option) any later version.
  9.  
  10. #This program is distributed in the hope that it will be useful,
  11. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #GNU General Public License for more details.
  14.  
  15. #You should have received a copy of the GNU General Public License
  16. #along with this program; if not, write to the Free Software
  17. #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.  
  20. # Configuration subroutine to validate and canonicalize a configuration type.
  21. # Supply the specified configuration type as an argument.
  22. # If it is invalid, we print an error message on stderr and exit with code 1.
  23. # Otherwise, we print the canonical config type on stdout and succeed.
  24.  
  25. # This file is supposed to be the same for all GNU packages
  26. # and recognize all the CPU types, system types and aliases
  27. # that are meaningful with *any* GNU software.
  28. # Each package is responsible for reporting which valid configurations
  29. # it does not support.  The user should be able to distinguish
  30. # a failure to support a valid configuration from a meaningless
  31. # configuration.
  32.  
  33. # The goal of this file is to map all the various variations of a given
  34. # machine specification into a single specification in the form:
  35. #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  36. # it is wrong to echo any other type of specification
  37.  
  38. # First pass through any local machine types.
  39. case $1 in
  40.     *local*)
  41.         echo $1
  42.         exit 0
  43.         ;;
  44.     *)
  45.     ;;
  46. esac
  47.  
  48. # Separate what the user gave into CPU-COMPANY and OS (if any).
  49. basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  50. if [ $basic_machine != $1 ]
  51. then os=`echo $1 | sed 's/.*-/-/'`
  52. else os=; fi
  53.  
  54. # Lets recognize common machines as not being OS so that things like
  55. # config.subr decstation-3100 as legal.
  56. case $os in
  57.     -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  58.     -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  59.     -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \
  60.     -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -osf* | \
  61.     -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  62.     -harris)
  63.         os=
  64.         basic_machine=$1
  65.         ;;
  66.     -sco*)
  67.         os=-scosysv322
  68.         basic_machine=i386-unknown
  69.         ;;
  70.     -isc*)
  71.         os=-iscsysv
  72.         basic_machine=i386-unknown
  73.         ;;
  74. esac
  75.  
  76. # Decode aliases for certain CPU-COMPANY combinations.
  77. case $basic_machine in
  78.     # Recognize the basic CPU types with without company name.
  79.     tahoe | i386 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
  80.         | tron | a29k | 580 | i960 | h8300 | v70)
  81.         basic_machine=$basic_machine-unknown
  82.         ;;
  83.     # Recognize the basic CPU types with with company name.
  84.     vax-* | tahoe-* | i386-* | i860-* | m68k-* | m68000-* | m88k-* \
  85.           | sparc-* | ns32k-* | alliant-* | arm-* | c[123]* \
  86.           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
  87.           | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
  88.           | hppa-*)
  89.         ;;
  90.     # Recognize the various machine names and aliases which stand
  91.     # for a CPU type and a company and sometimes even an OS.
  92.  
  93.  
  94.     vaxv)
  95.         basic_machine=vax-dec
  96.         os=-sysv
  97.         ;;
  98.     vms)
  99.         basic_machine=vax-dec
  100.         os=-vms
  101.         ;;
  102.     i386mach)
  103.         basic_machine=i386-mach
  104.         os=-mach
  105.         ;;
  106.     i386v32)
  107.         basic_machine=i386-unknown
  108.         os=-sysv32
  109.         ;;
  110.     i386-sco* | i386sco | sco)
  111.         basic_machine=i386-unknown
  112.         os=-scosysv322
  113.         ;;
  114.     i386-isc* | isc)
  115.         basic_machine=i386-unknown
  116.         os=-iscsysv
  117.         ;;
  118.     i386v4*)
  119.         basic_machine=i386-unknown
  120.         os=-sysv4
  121.         ;;
  122.     i386v)
  123.         basic_machine=i386-unknown
  124.         os=-sysv
  125.         ;;
  126.     spur)
  127.         basic_machine=spur-unknown
  128.         ;;
  129.     alliant)
  130.         basic_machine=alliant-alliant
  131.         ;;
  132.     convex-c1)
  133.         basic_machine=c1-convex
  134.         os=-sysv
  135.         ;;
  136.     convex-c2)
  137.         basic_machine=c2-convex
  138.         os=-sysv
  139.         ;;
  140.     convex-c32)
  141.         basic_machine=c32-convex
  142.         os=-sysv
  143.         ;;
  144.     convex-c34)
  145.         basic_machine=c34-convex
  146.         os=-sysv
  147.         ;;
  148.     convex-c38)
  149.         basic_machine=c38-convex
  150.         os=-sysv
  151.         ;;
  152.     m88k-omron*)
  153.         basic_machine=m88k-omron
  154.         ;;
  155.     merlin)
  156.         basic_machine=ns32k-utek
  157.         os=-sysv
  158.         ;;
  159.     crds | unos)
  160.         basic_machine=m68k-crds
  161.         ;;
  162.     encore | umax | mmax)
  163.         basic_machine=ns32k-encore
  164.         os=-sysv
  165.         ;;
  166.     genix)
  167.         basic_machine=ns32k-ns
  168.         ;;
  169.     iris | iris3 | iris4d)
  170.         basic_machine=mips-sgi
  171.         os=-irix3
  172.         ;;
  173.     iris4)
  174.         basic_machine=mips-sgi
  175.         os=-irix4
  176.         ;;
  177.     news | news700 | news800 | news900)
  178.         basic_machine=m68k-sony
  179.         os=-newsos
  180.         ;;
  181.     3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  182.         basic_machine=m68k-att
  183.         ;;
  184.     delta | 3300 | motorola-3300 | motorola-delta \
  185.           | 3300-motorola | delta-motorola)
  186.         basic_machine=m68k-motorola
  187.         ;;
  188.     balance)
  189.         basic_machine=ns32k-sequent
  190.         os=-dynix
  191.         ;;
  192.         pc532)
  193.         basic_machine=ns32k-pc532
  194.         ;;
  195.     symmetry)
  196.         basic_machine=i386-sequent
  197.         os=-dynix
  198.         ;;
  199.     sun2)
  200.         basic_machine=m68000-sun
  201.         ;;
  202.     sun2os3)
  203.         basic_machine=m68000-sun
  204.         os=-sunos3
  205.         ;;
  206.     sun2os4)
  207.         basic_machine=m68000-sun
  208.         os=-sunos4
  209.         ;;
  210.     sun3os3)
  211.         basic_machine=m68k-sun
  212.         os=-sunos3
  213.         ;;
  214.     sun3os4)
  215.         basic_machine=m68k-sun
  216.         os=-sunos4
  217.         ;;
  218.     sun4os3)
  219.         basic_machine=sparc-sun
  220.         os=-sunos3
  221.         ;;
  222.     sun4os4)
  223.         basic_machine=sparc-sun
  224.         os=-sunos4
  225.         ;;
  226.     sun3)
  227.         basic_machine=m68k-sun
  228.         ;;
  229.     sun4)
  230.         basic_machine=sparc-sun
  231.         ;;
  232.     pbd)
  233.         basic_machine=sparc-unicom
  234.         ;;
  235.     sun386 | sun386i | roadrunner)
  236.         basic_machine=i386-sun
  237.         ;;
  238.     ps2)
  239.         basic_machine=i386-ibm
  240.         ;;
  241.     next)
  242.         basic_machine=m68k-next
  243.         os=-sysv
  244.         ;;
  245.     hp9k3[2-9][0-9])
  246.         basic_machine=m68k-hp
  247.         ;;
  248.     hp9k31[0-9] | hp9k2[0-9][0-9])
  249.         basic_machine=m68000-hp
  250.         ;;
  251.     hp9k8[0-9][0-9] | hp9k7[0-9][0-9] | hp8[0-9][0-9] | hp7[0-9][0-9])
  252.         basic_machine=hp800-hp
  253.         ;;
  254.     isi68 | isi)
  255.         basic_machine=m68k-isi
  256.         os=-sysv
  257.         ;;
  258.     apollo68)
  259.         basic_machine=m68k-apollo
  260.         os=-sysv
  261.         ;;
  262.     apollo68bsd)
  263.         basic_machine=m68k-apollo
  264.         os=-bsd
  265.         ;;
  266.     altos | altos3068)
  267.         basic_machine=m68k-altos
  268.         ;;
  269.     miniframe)
  270.         basic_machine=m68000-convergent
  271.         ;;
  272.     tower | tower-32)
  273.         basic_machine=m68k-ncr
  274.         ;;
  275.     news-3600 | risc-news)
  276.         basic_machine=mips-sony
  277.         os=-newsos
  278.         ;;
  279.     st2000)
  280.         basic_machine=m68kmote-tandem
  281.         ;;
  282.     decstation-dec | decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
  283.         basic_machine=mips-dec
  284.         ;;
  285.     magnum | m3230)
  286.         basic_machine=mips-mips
  287.         os=-sysv
  288.         ;;
  289.     gmicro)
  290.         basic_machine=tron-gmicro
  291.         os=-sysv
  292.         ;;
  293.     rtpc | rtpc-*)
  294.         basic_machine=romp-ibm
  295.         ;;
  296.     am29k)
  297.         basic_machine=a29k-none
  298.         os=-bsd
  299.         ;;
  300.     amdahl)
  301.         basic_machine=580-amdahl
  302.         os=-sysv
  303.         ;;
  304.     amigados)
  305.         basic_machine=m68k-cbm
  306.         os=-amigados
  307.         ;;
  308.     amigaunix | amix)
  309.         basic_machine=m68k-cbm
  310.         os=-sysv4
  311.         ;;
  312.     stratus)
  313.         basic_machine=i860-stratus
  314.         os=-sysv4
  315.         ;;
  316.     cray | ymp)
  317.         basic_machine=ymp-cray
  318.         os=-unicos
  319.         ;;
  320.     cray2)
  321.         basic_machine=cray2-cray
  322.         os=-unicos
  323.         ;;
  324.     xmp)
  325.         basic_machine=xmp-cray
  326.         os=-unicos
  327.         ;;
  328.     delta88)
  329.         basic_machine=m88k-motorola
  330.         os=-m88kbcs
  331.         ;;
  332.     dpx2)
  333.         basic_machine=m68k-bull
  334.         os=-sysv
  335.         ;;
  336.     ebmon29k)
  337.         basic_machine=a29k-amd
  338.         os=-ebmon
  339.         ;;
  340.     h8300hds)
  341.         basic_machine=h8300-hitachi
  342.         os=-hds
  343.         ;;
  344.     harris)
  345.         basic_machine=m88k-harris
  346.         os=-m88kbcs
  347.         ;;
  348.     hp300bsd)
  349.         basic_machine=m68k-hp
  350.         os=-bsd
  351.         ;;
  352.     hp300hpux)
  353.         basic_machine=m68k-hp
  354.         os=-hpux
  355.         ;;
  356.     hp9k2[0-9][0-9] | hp9k31[0-9])
  357.         basic_machine=m68000-hp
  358.         os=-hpux
  359.         ;;
  360.     hp9k3[2-9][0-9])
  361.         basic_machine=m68k-hp
  362.         os=-hpux
  363.         ;;
  364.     ncr3000)
  365.         basic_machine=i386-ncr
  366.         os=-sysv4
  367.         ;;
  368.     necv70)
  369.         basic_machine=v70-nec
  370.         os=-sysv
  371.         ;;
  372.     news1000)
  373.         basic_machine=m68030-sony
  374.         os=-newsos
  375.         ;;
  376.     nindy960)
  377.         basic_machine=i960-intel
  378.         os=-nindy
  379.         ;;
  380.     pn)
  381.         basic_machine=pn-gould
  382.         os=-sysv
  383.         ;;
  384.     np1)
  385.         basic_machine=np1-gould
  386.         os=-sysv
  387.         ;;
  388.     ultra3)
  389.         basic_machine=a29k-nyu
  390.         os=-sym1
  391.         ;;
  392.     vxworks960)
  393.         basic_machine=i960-wrs
  394.         os=-vxworks
  395.         ;;
  396.     vxworks68)
  397.         basic_machine=m68k-wrs
  398.         os=-vxworks
  399.         ;;
  400.     os68k)
  401.         basic_machine=m68k-none
  402.         os=-os68k
  403.         ;;
  404.     none)
  405.         basic_machine=none-none
  406.         os=-none
  407.         ;;
  408.  
  409. # Here we handle the default manufacturer of certain CPU types.  It is in
  410. # some cases the only manufacturer, in others, it is the most popular.
  411.     mips)
  412.         basic_machine=mips-mips
  413.         ;;
  414.     romp)
  415.         basic_machine=romp-ibm
  416.         ;;
  417.     rs6000)
  418.         basic_machine=rs6000-ibm
  419.         ;;
  420.     vax)
  421.         basic_machine=vax-dec
  422.         ;;
  423.     sparc)
  424.         basic_machine=sparc-sun
  425.         ;;
  426.     fx2800)
  427.         basic_machine=i860-alliant
  428.         ;;
  429.     *)
  430.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  431.         exit 1
  432.         ;;
  433. esac
  434.  
  435. # Decode manufacturer-specific aliases for certain operating systems.
  436.  
  437. if [ "$os" ]
  438. then
  439. case $os in
  440.     # First accept the basic system types.
  441.     # The portable systems comes first.
  442.     # Each alternative must end in a *, to match a version number.
  443.     -bsd* | -sysv* | -mach* | -minix* | -genix* | -ultrix* \
  444.           | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
  445.           | -unos* | -osf* | -v88r* | -luna* | -dgux* | -solari* | -sym* \
  446.           | -amigados* | -msdos* | -newsos* | -none* | -os68k* | -irix* \
  447.           | -nindy* | -vxworks* | -ebmon* | -hds* | -m88kbcs*)
  448.         ;;
  449.  
  450. # Note that readline checks for newsos
  451. #    -newsos*)
  452. #        os=-bsd
  453. #        ;;
  454.     -osfrose*)
  455.         os=-osf
  456.         ;;
  457.     -osf*)
  458.         os=-bsd
  459.         ;;
  460.     -dynix*)
  461.         os=-bsd
  462.         ;;
  463.     -aos*)
  464.         os=-bsd
  465.         ;;
  466.     -ctix* | -uts*)
  467.         os=-sysv
  468.         ;;
  469.     -svr4)
  470.         os=-sysv4
  471.         ;;
  472.     -svr3)
  473.         os=-sysv3
  474.         ;;
  475.     *)
  476.         # Get rid of the `-' at the beginning of $os.
  477.         os=`echo $1 | sed 's/[^-]*-//'`
  478.         echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  479.         exit 1
  480.         ;;
  481. esac
  482. else
  483.  
  484. # Here we handle the default operating systems that come with various machines.
  485. # The value should be what the vendor currently ships out the door with their
  486. # machine or put another way, the most popular os provided with the machine.
  487. case $basic_machine in
  488.     *-dec | vax-*)
  489.         os=-ultrix42
  490.         ;;
  491.     i386-sun)
  492.         os=-sunos402
  493.         ;;
  494.     m68000-sun)
  495.         os=-sunos3
  496.         # This also exists in the configure program, but was not the
  497.         # default.
  498.         # os=-sunos4
  499.         ;;
  500.     sparc-* | *-sun)
  501.         os=-sunos411
  502.         ;;
  503.     romp-*)
  504.         os=-bsd
  505.         ;;
  506.     *-ibm)
  507.         os=-aix
  508.         ;;
  509.     *-hp)
  510.         os=-hpux
  511.         ;;
  512.     *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  513.         os=-sysv
  514.         ;;
  515.     *-dg)
  516.         os=-dgux
  517.         ;;
  518.     m88k-omron*)
  519.         os=-luna
  520.         ;;
  521.     *-crds)
  522.         os=-unos
  523.         ;;
  524.     *-ns)
  525.         os=-genix
  526.         ;;
  527.     i386-*)
  528.         os=-scosysv322
  529.         ;;
  530.     *)
  531.         os=-none
  532.         ;;
  533. esac
  534. fi
  535.  
  536. # Here we handle the case where we know the os, and the CPU type, but not the
  537. # manufacturer.  We pick the logical manufacturer.
  538. vendor=unknown
  539. case $basic_machine in
  540.     *-unknown)
  541.         case $os in
  542.             -sunos*)
  543.                 vendor=sun
  544.                 ;;
  545.             -aix*)
  546.                 vendor=ibm
  547.                 ;;
  548.             -hpux*)
  549.                 vendor=hp
  550.                 ;;
  551.             -unos*)
  552.                 vendor=crds
  553.                 ;;
  554.             -dgux*)
  555.                 vendor=dg
  556.                 ;;
  557.             -luna*)
  558.                 vendor=omron
  559.                 ;;
  560.             -genix*)
  561.                 vendor=ns
  562.                 ;;
  563.         esac
  564.         basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  565.         ;;
  566. esac
  567.  
  568. echo $basic_machine$os
  569.